package org.example.frame;
import javax.swing.*;
import java.awt.*;
import org.example.model.*;
import org.example.panel.*;
import org.example.panel.helppanel.*;

/**
 * @author lenovo
 */

public class HelpFrame extends JFrame {
    public HelpFrame(User user){
        //组件准备
        JTabbedPane tabbedPane = new JTabbedPane();
        UserCourseHelpPanel userCourseHelp = new UserCourseHelpPanel();
        StudentScoreHelpPanel studentScoreHelp = new StudentScoreHelpPanel();
        Data1HelpPanel data1Help = new Data1HelpPanel();
        Data2HelpPanel data2Help = new Data2HelpPanel();
        ReturnFramePanel returnFrame = new ReturnFramePanel(user,this);
        //添加组件
        tabbedPane.add("用户与课程帮助",userCourseHelp);
        tabbedPane.add("学生与成绩帮助",studentScoreHelp);
        tabbedPane.add("数据帮助1",data1Help);
        tabbedPane.add("数据帮助2",data2Help);
        tabbedPane.add("返回界面",returnFrame);
        add(new JLabel("当前用户用户名："+user.getUsername()), BorderLayout.NORTH);
        add(tabbedPane,BorderLayout.CENTER);
        //窗口设置
        setTitle("学生成绩管理->必看帮助");
        setSize(500,400);
        setLocationRelativeTo(null);
        setVisible(true);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        validate();
    }
}
